package cn.lcsjsxy.yxz.day.Abnormal;

//常见异常1
public class Common1 {

    /*

    */

    public static void main(String[] args) {

        int a = 0;
        int c = 10;

        if ( a != 0){
            int b = 10 / a;
        }

        //-----------------

        //空指针异常
        User3 user = null;
//        if (user != null){
//            System.out.println(user.toString());
//        }
        try {
//            System.out.println(user.toString());
            System.out.println(user.name);
        }catch (NullPointerException e){
            System.out.println("空");
        }

    }

}

class  User3{

    public boolean name;
}